package Others.DesignPattern.StrategyPattern.Pattern.Strategy;


public class RebateCollectMoney extends DiscountStrategy {

    private final double moneyCondition;
    private final double moneyReturn;

    public RebateCollectMoney(double totalMoney, double moneyCondition, double moneyReturn) {
        super(totalMoney);
        this.moneyCondition = moneyCondition;
        this.moneyReturn = moneyReturn;
    }

    @Override
    public void getDiscountPrice() {
        if (totalMoney >= moneyCondition)
            System.out.println("返现收费：消费金额为" + (totalMoney - moneyReturn));
        else System.out.println("普通收费：消费金额为" + totalMoney);
    }

}
